﻿Imports System.IO

Module 共通モジュール

#Region "Public変数"
    Public 会社 As String = "物流技術研究所"
    Public 著作権 As String = " 寺本敏幸"

    Public MyPath As String = System.Environment.CurrentDirectory
    '  Public Dat保存Path As String
    Public SoftDataPath As String
#End Region

#Region "  ファイルパス"

    Public MyData As String = ""
    Public MyDB As String
    Public MyTable As String
    Public MyExcel As String
    Public MySheet As String

    Public MySQL As String = ""
    Public MyDgv As DataGridView

    Public T200_Chk As Integer
    Public 出荷データ_Chk As Integer
    Public T230_ケースバラ全集計_Chk As Integer
    Public ケースバラ_Chk As Integer

    Public 選択設備 As String = ""
    Public 出荷日数 As Integer
#End Region

    Public トグロスイッチ As Integer = 0
    Public Dat保存Path As String
    Public モデル保存Path As String
    Public 計算結果Path As String

    Public Sub ファイル確認()
        Dim chk As Integer = 0
        'フォルダーの存在確認 System.IO.Directory.Exists()
        If System.IO.Directory.Exists("A:\Tera計算Data\EIQ分析AI化") Then Dat保存Path = "A:\Tera計算Data\EIQ分析AI化" : chk += 1
        If System.IO.Directory.Exists("B:\Tera計算Data\EIQ分析AI化") Then Dat保存Path = "B:\Tera計算Data\EIQ分析AI化" : chk += 1
        If System.IO.Directory.Exists("C:\Tera計算Data\EIQ分析AI化") Then Dat保存Path = "C:\Tera計算Data\EIQ分析AI化" : chk += 1
        If System.IO.Directory.Exists("D:\Tera計算Data\EIQ分析AI化") Then Dat保存Path = "D:\Tera計算Data\EIQ分析AI化" : chk += 1
        If System.IO.Directory.Exists("E:\Tera計算Data\EIQ分析AI化") Then Dat保存Path = "E:\Tera計算Data\EIQ分析AI化" : chk += 1
        If System.IO.Directory.Exists("F:\Tera計算Data\EIQ分析AI化") Then Dat保存Path = "F:\Tera計算Data\EIQ分析AI化" : chk += 1

        If chk = 0 Then
            MsgBox("dataディレクトリが存在しません,[Tera計算Data\EIQ分析AI化]を任意のドライブに複写")
            End
        ElseIf chk >= 2 Then
            MsgBox("dataディレクトリが複数存在します")
            End
        End If

        'ファイルパス
        モデル保存Path = Dat保存Path & "\Models"
        計算結果Path = Dat保存Path & "\計算結果"
    End Sub

    Public Sub Access最適化(MyDB As String, Saizu As Integer)



    End Sub

End Module
